<%@include file="startUpIncludes.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>
            Views
        </title>
        <script type="text/javascript">
        $(document).ready(function(){
        $('.fire-view-date').click(function(){
    		var viewId = this.id;
    		$(".modal-win-ok").attr("href", "view.html?viewId=" + viewId);
            $('.modal-win-start').click(function(){
	    		startDate= $("#startDate").val();
	    		endDate= $("#endDate").val();
	    		$(".modal-win-start").attr("href", "view.html?viewId=" + viewId + "&startDate=" + startDate + "&endDate=" + endDate);
            });
    	    $(this).modalWinShow();
    	    });
        });
        </script>
    </head>
    <body>
    <jsp:include page="header.jsp" >
		<jsp:param value="true" name="loggedIn"/>
	</jsp:include>
    <div class="modal-win-bg">
        <div class="modal-win-box">
            <div class="modal-win-hd">
                <span class="modal-win-title"></span>
                <span class="modal-win-close">x</span>
            </div>
            <div class="modal-win-content">
	            <div style="float: left; clear: both; margin: 10px; width: 100%;">
		            <label>StartDate:</label>
		            <input type='text' id="startDate" class="TB"/>
	            </div>
	            <div style="float: left; clear: both; margin: 10px; width: 100%;">
		            <label>EndDate:</label>
		            <input type='text' id="endDate" class="TB"/>
		        </div>
            </div>
            <a class="form-btn modal-win-start">Ok</a>
            <a class="form-btn modal-win-ok">Use Default</a>
        </div>
    </div>
    <div class="wrap">
	<div class="fitBG">
        <div class="main">
		<%@include file="basicLeftMenu.jsp" %>
            <div class="content">
				<jsp:include page="tabs.jsp" >
					<jsp:param value="views" name="currentPage"/>
				</jsp:include>
                <div class="tab-content">
                <h3>Views</h3>
                <div class="content-block">
                    <h4>My Views</h4>
	                <div class="btns">
	                	<a href="/sales/s/new-lead-view" class="form-btn">New View</a>
	                </div>
                    <div class="scroll-table">
                    <table class="recent-leads">
                        <thead>
                            <tr>
								<th>View Name</th>
								<th>Employee</th>
								<th>View</th>
                            </tr>
                        </thead>
                        <tbody>
                			<c:forEach items="${empViews}" var="view">
                              <tr class="even">
								<td>${view.name}</td>
								<td>${view.viewOwner.fName}</td>
								<td><a id="${view.id}" class="fire-view-date">View</a></td>
                              </tr>
                           </c:forEach>
                        </tbody>
                    </table>
                    </div>
                </div>
                </div>
            </div>
        </div>
    <%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>